package jvm;

/**
 * @Author: admin
 * @Description:
 * @Date: 2018/8/5 14:24
 */

public class GcTest {
    public static void main(String [] args) throws InterruptedException {
        Thread.sleep(10000*6);

        for (int i=0;i<10000000;i++){
            System.out.println("-------------------");
            new InnerClass();
        }
        Thread.sleep(10000*6);
        for (int i=0;i<10000000;i++){
            System.out.println("-------------------");
            new InnerClass();
        }

        for(int i=0; i<10000;i++){
            System.out.println("主线程 "+i);
        }
    }



}

class InnerClass{
    @Override
    public void finalize(){
        System.out.println("垃圾回收......");
    }
}
